home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / lanutsrc.zip / SENDTEST.C < prev    next >
Text File  |  1991-03-13  |  1KB  |  55 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <dos.h>
  5. #include <direct.h>
  6. #include <conio.h>
  7.  
  8. #include "lantasti.h"
  9.  
  10. #define DOS 0x21
  11. #define NETBIOS 0x5C
  12.  
  13. /* structure to allow easy access to both segment and offset portions of
  14.    far pointers */
  15. /* definitions to save typing time */
  16. struct msg_buffer msg;
  17. struct SREGS segregs;
  18. union REGS registers;
  19. struct SEGOFFS {
  20.   unsigned offs;
  21.   unsigned seg;
  22. };
  23. typedef union POINTER {
  24.   unsigned char *ptr;
  25.   struct SEGOFFS l;
  26. } POINTER;        
  27. union POINTER ptr;
  28.  
  29.  
  30. /* main ********************************************************************
  31.  
  32. *****************************************************************************/
  33. int main(argc,argv)
  34.   int argc;
  35.   char *argv[];
  36. {
  37.   if (argc < 2) {
  38.     puts("Usage: sendtest machine message.");
  39.     exit(FALSE);
  40.   }
  41.  
  42.   ptr.ptr = &msg;                 /* set up structure for message */
  43.   strcpy(msg.text,argv[1]);  
  44.   strcpy(msg.destination,argv[0]);
  45.  
  46.   segregs.ds = ptr.l.seg;         /* set up regs for interrupt call */
  47.   registers.x.si = ptr.l.offs;
  48.   registers.x.ax = 0x5f98;
  49.  
  50.   for(i = 0; i < 65535; i++) intdosx(®isters,®isters,&segregs);
  51.   
  52. /* outta there */
  53.   return(0);
  54. }
  55.